package com.ungao.framework.reflection;

public class CaseConverter {

    /**
     * 首字母大写转换
     *
     * @param content
     * @return
     */
    public static String toUpperCase(String content) {
        if (Character.isUpperCase(content.charAt(0))) {
            return content;
        }
        return new StringBuilder()
                .append(Character.toUpperCase(content.charAt(0)))
                .append(content.substring(1))
                .toString();
    }

    /**
     * 首字母小写转换
     *
     * @param content
     * @return
     */
    public static String toLowerCase(String content) {
        if (Character.isLowerCase(content.charAt(0))) {
            return content;
        }
        return new StringBuilder()
                .append(Character.toLowerCase(content.charAt(0)))
                .append(content.substring(1))
                .toString();
    }
}
